#include<bits/stdc++.h>
using namespace std;
const int inf=1e5+5;
int a[inf],c[inf],d[inf],e[inf];
bool cmp(int a,int b)
{
	return a>b;
}
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n,ans=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	sort(a,a+n,cmp);
	int mx=0;
	for(int i=0;i<n;i++)
	{
		c[a[i]]++;
		mx=max(mx,a[i]);
	}
	d[mx]=0;
	e[mx]=c[mx];
	for(int i=mx-1;i>=0;i--)
	{
		d[i]=c[i+1]+d[i+1];
		int cnt=c[i]-d[i];
		if(cnt>=0)
		{
			e[i]=cnt;
			d[i]=0;
		}
		else
		{
			d[i]-=c[i];
			e[i]=0;
		}
	}
	for(int i=0;i<=mx;i++)
	{
		ans+=e[i];
	}
	cout<<ans<<endl;
	return 0;
}
